<?php 
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header', 'admin');
?>

<div class="pad-lr-10">


<form name="searchform" action="" method="get" >
<input type="hidden" value="teacherinfo" name="m">
<input type="hidden" value="teacherinfo" name="c">
<input type="hidden" value="search" name="a">
<table width="100%" cellspacing="0" class="search-form">
    <tbody>
		<tr>
		<td>
		<div class="explain-col">
            姓名：<input name="name" size="5" type="text" value="<?php if(isset($_GET['name'])) {echo $_GET['name'];}?>" class="input-text" />
            工号：<input name="number" type="text" value="<?php if(isset($_GET['number'])) {echo $_GET['number'];}?>" class="input-text" />
			专业：<input name="major" type="text" value="<?php if(isset($_GET['major'])) {echo $_GET['major'];}?>" class="input-text" />
			批次：<input name="batch" type="text" value="<?php if(isset($_GET['batch'])) {echo $_GET['batch'];}?>" class="input-text" />
            <input type="submit" name="search" class="button" value="<?php echo L('search')?>" />
		</div>
		</td>
		</tr>
    </tbody>
</table>
</form>




<form name="myform" action="?m=teacherinfo&c=teacherinfo&a=listorder" method="post">
<div class="table-list">
    <table width="100%" cellspacing="0">
        <thead>
            <tr>
            <th width="35" align="center"><input type="checkbox" value="" id="check_box" onclick="selectall('id[]');"></th>
			<th width="100" align="center"><?php echo "教师姓名"?></th>
			<th width="100" align="center"><?php echo "工号"?></th>
			<th width="100" align="center"><?php echo "密码"?></th>
			<th width="100" align="center"><?php echo "专业"?></th>
			<th width="100" align="center"><?php echo "类型"?></th>
			<th width="100" align="center"><?php echo "批次"?></th>
			<th width="80" align="center"><?php echo L('operations_manage')?></th>
            </tr>
        </thead>
    <tbody>
 <?php 
if(is_array($data)){
	foreach($data as $teacherinfo){
?>   
	<tr>
	<td align="center">
	<input type="checkbox" name="id[]" value="<?php echo $teacherinfo['id']?>">
	</td>
	<td align="center"><?php echo $teacherinfo['username']?></td>
	<td align="center"><?php echo $teacherinfo['number']?></td>
	<td align="center"><?php echo $teacherinfo['password']?></td>
	<td align="center"><?php echo $teacherinfo['major']?></td>
	<td align="center"><?php echo $type[$teacherinfo['type']]?></td>
	<td align="center"><?php echo $teacherinfo['batch']?></td>
	<td align="center">
	<a href="?m=teacherinfo&c=teacherinfo&a=delete&id=<?php echo $teacherinfo['id']?>" title="<?php echo "删除"?>"  target="_blank"><?php echo "删除"?></a> | 
	<a href="javascript:edit('<?php echo $teacherinfo['id']?>', '<?php echo safe_replace($teacherinfo['username'])?>');void(0);"><?php echo L('edit')?></a>
	</td>
	</tr>
<?php 
	}
}
?>
</tbody>
    </table>
  
    <div class="btn"><label for="check_box"><?php echo L('selected_all')?>/<?php echo L('cancel')?></label>
        <input name='submit' type='submit' class="button" value='<?php echo "导入EXCEL文件信息"?>' onClick="document.myform.action='?m=teacherinfo&c=teacherinfo&a=import'">&nbsp;&nbsp;
		<input name="submit" type="submit" class="button" value="<?php echo "删除所选信息"?>" onClick="document.myform.action='?m=teacherinfo&c=teacherinfo&a=delete';return confirm('<?php echo "确认删除？"?>')">&nbsp;&nbsp;</div>  </div>
	
	<div id="pages"><?php echo $this->teacherinfo_db->pages;?></div>
</form>
</div>
</body>
</html>
<script type="text/javascript">
function edit(id, title) {
	window.top.art.dialog({id:'edit'}).close();
	window.top.art.dialog({title:'<?php echo "编辑教师信息"?>--'+title, id:'edit', iframe:'?m=teacherinfo&c=teacherinfo&a=edit&id='+id ,width:'700px',height:'500px'}, function(){var d = window.top.art.dialog({id:'edit'}).data.iframe;
	var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'edit'}).close()});
}
</script>